import { request } from '@/api/service'

export default {
  getVolunteerList (params) {
    return request({
      url: '/api/volunteer/page',
      method: 'get',
      params
    })
  },
  addVolunteer (data) {
    return request({
      url: '/api/volunteer/add',
      method: 'post',
      data
    })
  },
  updateVolunteer (data) {
    return request({
      url: '/api/volunteer/edit',
      method: 'post',
      data
    })
  },
  deleteVolunteer (id) {
    return request({
      url: '/api/volunteer/delete',
      method: 'post',
      data: {
        id
      }
    })
  },
  // 查询当前志愿者献血记录
  getBloodRecord (id) {
    return request({
      url: '/api/blood/get',
      method: 'get',
      params: {
        volunteerId: id
      }
    })
  }
}
